package com.wkbb.sports.feign;

import com.wkbb.common.dto.ResultDTO;
import com.wkbb.common.dto.basic.*;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(name = "wkbb-open-service")
public interface OpenFeignService {

    @ApiOperation(value = "查询组织信息")
    @RequestMapping(value = "/open/v1/school/getOrgById", method = RequestMethod.GET)
    ResultDTO<OrganizationDto> getOrgById(@ApiParam(value = "组织ID", required = false) @RequestParam(name = "orgId", required = false) Long orgId);

    @ApiOperation(value = "根据学校类型查询年级列表")
    @RequestMapping(value = "/open/v1/school/getGradeInfoList", method = RequestMethod.GET)
    ResultDTO<List<GradeDto>> getGradeInfoList(
            @ApiParam(value = "年级类型(1幼儿园 2小学 3中职 4初中 5高中 6高职 7本科 8完中 9九年一贯 10十二年一贯)", required = true) @RequestParam(name = "gradeType", required = true) Integer gradeType);

    @ApiOperation(value = "查询年级信息")
    @RequestMapping(value = "/open/v1/school/getGrade", method = RequestMethod.GET)
    ResultDTO<GradeDto> getGrade(@ApiParam(value = "年级ID", required = true) @RequestParam(name = "gradeId", required = true) Long gradeId);

    @ApiOperation(value = "根据名称查询年级")
    @RequestMapping(value = "/open/v1/school/getGradeByName", method = RequestMethod.GET)
    ResultDTO<GradeDto> getGradeByName(
            @ApiParam(value = "组织ID", required = true) @RequestParam(name = "orgId", required = true) Long orgId,
            @ApiParam(value = "年级名称", required = true) @RequestParam(name = "gradeName", required = true) String gradeName);

    @ApiOperation(value = "年级列表")
    @RequestMapping(value = "/open/v1/school/getGradeList", method = RequestMethod.GET)
    ResultDTO<List<GradeDto>> getGradeList(
            @ApiParam(value = "学校ID", required = true) @RequestParam(name = "orgId", required = true) Long orgId,
            @ApiParam(value = "年级类型(1幼儿园 2小学 3中职 4初中 5高中 6高职 7本科 8完中 9九年一贯 10十二年一贯)", required = true) @RequestParam(name = "gradeType", required = true) Integer gradeType);

    @ApiOperation(value = "查询班级信息")
    @RequestMapping(value = "/open/v1/school/getClass", method = RequestMethod.GET)
    ResultDTO<ClassInfoDto> getClass(
            @ApiParam(value = "组织ID", required = true) @RequestParam(name = "orgId", required = true) Long orgId,
            @ApiParam(value = "班级ID", required = true) @RequestParam(name = "classId", required = true) Long classId);

    @ApiOperation(value = "获取班级年级树形结构")
    @RequestMapping(value = "/open/v1/school/getClassTree", method = RequestMethod.GET)
    ResultDTO<List<GradeTreeDto>> getClassTree(@ApiParam(value = "组织ID", required = true) @RequestParam(name = "orgId", required = true) Long orgId);

    @ApiOperation(value = "根据名称查询班级")
    @RequestMapping(value = "/open/v1/school/getClassByName", method = RequestMethod.GET)
    ResultDTO<ClassInfoDto> getClassByName(
            @ApiParam(value = "组织ID", required = true) @RequestParam(name = "orgId", required = true) Long orgId,
            @ApiParam(value = "年级ID", required = true) @RequestParam(name = "gradeId", required = true) Long gradeId,
            @ApiParam(value = "班级名称", required = true) @RequestParam(name = "className", required = true) String className);

    @ApiOperation(value = "统计学校总体数据")
    @RequestMapping(value = "/open/v1/school/getOrgDataStat", method = RequestMethod.GET)
    ResultDTO<List<Map<String, Object>>> getOrgDataStat(@ApiParam(value = "组织ID", required = true) @RequestParam(name = "orgId", required = true) Long orgId);

    @ApiOperation(value = "根据学号查询学生信息")
    @RequestMapping(value = "/open/v1/student/getStudentByStudentNo", method = RequestMethod.GET)
    ResultDTO<StudentInfoDto> getStudentByStudentNo(
            @ApiParam(value = "学校ID", required = true) @RequestParam(name = "orgId", required = true) Long orgId,
            @ApiParam(value = "学号", required =true) @RequestParam(name = "studentNo", required = true) String studentNo);

    @ApiOperation(value = "根据年级查询学生列表")
    @RequestMapping(value = "/open/v1/student/getGradeStudentList", method = RequestMethod.GET)
    ResultDTO<List<StudentInfoDto>> getGradeStudentList(
            @ApiParam(value = "学校ID", required = true) @RequestParam(name = "orgId", required = true) Long orgId,
            @ApiParam(value = "年级ID", required = true) @RequestParam(name = "gradeId", required = true) Long gradeId,
            @ApiParam(value = "性别", required = false) @RequestParam(name = "sex", required = false) String sex);

    @ApiOperation(value = "查询班级学生列表")
    @RequestMapping(value = "/open/v1/student/getClassStudentList", method = RequestMethod.GET)
    ResultDTO<List<StudentInfoDto>> getClassStudentList(
            @ApiParam(value = "学校ID", required = true, defaultValue = "1") @RequestParam(name = "orgId", required = true) Long orgId,
            @ApiParam(value = "班级ID", required = true, defaultValue = "1") @RequestParam(name = "classId", required = true) Long classId);

    @ApiOperation(value = "查询教师任课班级列表")
    @GetMapping(value = "/open/v1/teacher/getTeacherClassList")
    public ResultDTO<List<ClassInfoDto>> getTeacherClassList(
            @ApiParam(value = "学校ID", required = true) @RequestParam(name = "orgId", required = true) Long orgId,
            @ApiParam(value = "用户ID", required = true) @RequestParam(name = "userId", required = true) Long userId);

    @ApiOperation(value = "查询教师信息")
    @GetMapping(value = "/open/v1/teacher/getTeacherInfo")
    public ResultDTO<EmployeeInfoDto> getTeacherInfo(
            @ApiParam(value = "学校ID", required = true) @RequestParam(name = "orgId", required = true) Long orgId,
            @ApiParam(value = "用户ID", required = true) @RequestParam(name = "userId", required = true) Long userId);

    @ApiOperation(value = "查询城市下的学校")
    @RequestMapping(value = "/open/v1/school/getOrgListByCity", method = RequestMethod.GET)
    ResultDTO<List<Long>> getOrgListByCity(@ApiParam(value = "组织ID", required = true) @RequestParam(name = "orgId", required = true) Long orgId);

}